<?php

namespace app\traits;

trait Auth
{
	/**
	 * 获取用户ID
	 * @return mixed
	 */
	function getUserId()
	{
		return $this->app->request->user_id;
	}
	
	/**
	 * 获取密码加密后的字符串
	 * @param string $password 密码
	 * @param string $salt 密码盐
	 * @return string
	 */
	public function getEncryptPassword($password, $salt = '')
	{
		return md5(md5($password) . $salt);
	}
}